const path = require('path')
const entry = require('webpack-glob-entry')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
module.exports = {
  entry: entry('./public/epin/*.js'), //入口文件
  output: {
    //输出文件路径设置
    path: path.resolve(__dirname, '../public/epin/min'),
    // filename: '[name].[chunkhash].js',
    filename: '[name].js'
  },
  plugins: [
    new CleanWebpackPlugin() //清理dist文件夹
  ],
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel-loader'
      }
    ]
  }
}
